package constellation.Activity;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.example.myapplication.R;

import constellation.util.AssetsUtil;
import constellation.util.StartInfo;

public class StartInfoActivity extends AppCompatActivity {


    private ImageView startInfoImage;
    private TextView startInfoText;
    private TextView startInfoTime;
    private TextView character;
    private TextView house;
    private TextView TaiJi;
    private TextView characteristic;
    private TextView star;
    private TextView color;
    private TextView jewelry;
    private TextView number;
    private TextView metal;
    private TextView startInfoDetails;
    private ImageView back;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start_info);
        initView();
        StartInfo.StarinfoBean bean=(StartInfo.StarinfoBean) getIntent().getSerializableExtra("details");
        startInfoText.setText(bean.getName());
        String logoname=bean.getLogoname();
        String filename="xzlogo/"+logoname+".png";
        Bitmap bitmap= AssetsUtil.getBitmapByAssets(this,filename);
        startInfoImage.setImageBitmap(bitmap);
        startInfoTime.setText(bean.getDate());
        character.setText(bean.getTd());
        house.setText(bean.getGw());
        TaiJi.setText(bean.getYy());
        characteristic.setText(bean.getTz());
        star.setText(bean.getZg());
        color.setText(bean.getYs());
        jewelry.setText(bean.getZb());
        number.setText(bean.getHm());
        metal.setText(bean.getJs());
        startInfoDetails.setText(bean.getInfo());

    }
    private void initView() {
        startInfoImage = (ImageView) findViewById(R.id.start_info_image);
        startInfoText = (TextView) findViewById(R.id.start_info_text);
        startInfoTime = (TextView) findViewById(R.id.start_info_time);
        character = (TextView) findViewById(R.id.character);
        house = (TextView) findViewById(R.id.house);
        TaiJi = (TextView) findViewById(R.id.TaiJi);
        characteristic = (TextView) findViewById(R.id.characteristic);
        star = (TextView) findViewById(R.id.star);
        color = (TextView) findViewById(R.id.color);
        jewelry = (TextView) findViewById(R.id.jewelry);
        number = (TextView) findViewById(R.id.number);
        metal = (TextView) findViewById(R.id.metal);
        startInfoDetails = (TextView) findViewById(R.id.start_info_details);
        back = (ImageView) findViewById(R.id.back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

}
